package hashtable;

import structure.stack.StackByArray;

import java.util.Scanner;

/**
* @description: hash表的实现
* @author: wangjun
* @create: 2022-04-26
*/
public class HashTabMain {
    public static void main(String[] args) {
        System.out.println("hashtable测试：");
        EmpLinkedListArray empList = new EmpLinkedListArray(7);
        Scanner sc = new Scanner(System.in);
        while (true){
            System.out.println("add添加");
            System.out.println("list显示");
            System.out.println("exit退出");
            System.out.println("find查找");
            switch (sc.next()){
                case "add":
                    System.out.println("请输入id:");
                    int empId = sc.nextInt();
                    System.out.println("请输入name:");
                    String name = sc.next();
                    Emp emp1 = new Emp(empId,name);
                    empList.add(emp1);
                    break;
                case "list":
                    empList.list();
                    break;
                case "find":
                    System.out.println("请输入员工编号：");
                    int no = sc.nextInt();
                    empList.findEmpById(no);
                    break;
                case "exit":
                    System.exit(0);
            }
        }
    }
}